window.onload = function(){
    var time = document.getElementById('time');
    window.setInterval(times,1000);
    function times(){
        var res = new Date();
        var y = res.getFullYear();
        var m = res.getMonth();
        var date = res.getDate();
        var h = res.getHours();
        var min = res.getMinutes();
        var sec = res.getSeconds();
        time.innerHTML = y+'-'+m+'-'+date+' ' +h+':'+min+":"+sec;
    }






}